package com.simplecontact.activities;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.TabHost;

import com.simplecontact.R;

public class ActMain extends TabActivity {
	
	public static TabHost mTabHost;		
	
		
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mTabHost = getTabHost();
        Resources r = getResources();        
        prepareTab(r.getString(R.string.strMembers), r.getDrawable(R.drawable.tabmember),r.getString(R.string.strGroups), r.getDrawable(R.drawable.tabgroup),r.getString(R.string.strMap), r.getDrawable(R.drawable.map), r.getString(R.string.strCalendar),r.getDrawable(R.drawable.tabcalendar));                              
    }

	public static void prepareTab(String texttab1, Drawable icontab1,String texttab2, Drawable icontab2, String texttab3, Drawable icontab3,String texttab4, Drawable icontab4) {		 
		mTabHost.clearAllTabs();				
		mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator(texttab1,icontab1).setContent(new Intent("android.intent.action.DOCONTACT")));		
		mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator(texttab2,icontab2).setContent(new Intent("android.intent.action.DOGROUP")));		
		mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator(texttab3,icontab3).setContent(new Intent("android.intent.action.VIEWMAP")));
		mTabHost.addTab(mTabHost.newTabSpec("tab_test4").setIndicator(texttab4,icontab4).setContent(new Intent("android.intent.action.DOCALENDAR")));       
		mTabHost.setCurrentTab(1);		
	}               
}